package com.weiquan.common;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 响应状态码枚举
 * 
 * @author weiquan
 * @since 2024-01-01
 */
@Getter
@AllArgsConstructor
public enum ResultCode {
    
    // 通用状态码
    SUCCESS(200, "操作成功"),
    ERROR(500, "操作失败"),
    PARAM_ERROR(400, "参数错误"),
    UNAUTHORIZED(401, "未授权"),
    FORBIDDEN(403, "禁止访问"),
    NOT_FOUND(404, "资源不存在"),
    
    // 用户相关
    USER_NOT_EXIST(1001, "用户不存在"),
    USER_DISABLED(1002, "用户已被禁用"),
    PHONE_EXIST(1003, "手机号已存在"),
    LOGIN_ERROR(1004, "用户名或密码错误"),
    TOKEN_INVALID(1005, "token无效"),
    TOKEN_EXPIRED(1006, "token已过期"),
    
    // 短信相关
    SMS_SEND_ERROR(2001, "短信发送失败"),
    SMS_CODE_ERROR(2002, "验证码错误"),
    SMS_CODE_EXPIRED(2003, "验证码已过期"),
    SMS_SEND_FREQUENT(2004, "短信发送过于频繁"),
    
    // 社区相关
    POST_NOT_EXIST(3001, "帖子不存在"),
    POST_DELETED(3002, "帖子已被删除"),
    COMMENT_NOT_EXIST(3003, "评论不存在"),
    ALREADY_LIKED(3004, "已经点赞过了"),
    ALREADY_COLLECTED(3005, "已经收藏过了"),
    
    // 模板相关
    TEMPLATE_NOT_EXIST(4001, "模板不存在"),
    TEMPLATE_DISABLED(4002, "模板已被禁用"),
    
    // AI相关
    AI_SERVICE_ERROR(5001, "AI服务异常"),
    AI_QUOTA_EXCEEDED(5002, "AI咨询次数已用完"),
    
    // 文件相关
    FILE_UPLOAD_ERROR(6001, "文件上传失败"),
    FILE_TYPE_ERROR(6002, "文件类型不支持"),
    FILE_SIZE_ERROR(6003, "文件大小超出限制");
    
    private final Integer code;
    private final String message;
}